package com.itheima.pojo.dto;

import com.itheima.pojo.pojo.Role;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;


@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RoleDto {
    private String name;
    private String remark;
    public Role toRole(){

        Role role=new Role();
        BeanUtils.copyProperties(this,role);
        role.setCreateTime((new Date()));
        role.setUpdateTime((new Date()));
        return role;
    }
}
